package com.caiden_micheal.dynamic.process.web;

import com.caiden_micheal.base.domain.AjxResult;
import com.caiden_micheal.dynamic.process.dto.findExistenceByFormWorkflowIdDTO;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.PostMapping;
import com.caiden_micheal.dynamic.process.dto.DProcessAddDTO;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import com.caiden_micheal.dynamic.process.service.DProcessService;
import com.caiden_micheal.dynamic.process.dto.DProcessQueryConditionDTO;

@RestController
@RequestMapping("/dProcess")
public class DProcessController {
    @Autowired
    private DProcessService dProcessService;

    @PostMapping("/addDProcess")
    public AjxResult addDProcess(@RequestBody DProcessAddDTO dProcessAddDTO) {
        return dProcessService.addDProcess(dProcessAddDTO);
    }

    @PostMapping("/queryCondition")
    public AjxResult queryCondition(@RequestBody DProcessQueryConditionDTO dProcessQueryConditionDTO) {
        return AjxResult.success(dProcessService.queryCondition(dProcessQueryConditionDTO));
    }

    @PostMapping("/findExistenceByFormWorkflowId")
    public AjxResult findExistenceByFormWorkflowId(@RequestBody findExistenceByFormWorkflowIdDTO findExistenceByFormWorkflowIdDTO) {
        return dProcessService.findExistenceByFormWorkflowId(findExistenceByFormWorkflowIdDTO);
    }
}
